/* $Revision: $ $Date: $
 * 
 * Copyright (C) 2009 Robert Stephan
 * 
 * This file is part of *** CaCaO - Card Catalogs Online ***
 *
 * CaCaO is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CaCao is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package cacao.client.ui;

import cacao.client.CaCaO;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.HTML;


public class TopLeftCmp extends Composite implements CaCaOComposite{
	private CaCaO application;
	private DockLayoutPanel panel;

	public TopLeftCmp(CaCaO app){
		application=app;		
		panel = new DockLayoutPanel(Unit.PX);
		panel.setStylePrimaryName("panel-topleft");
		HTML topLeftHTML = new HTML(application.getMessages().topHTML());
		panel.addWest(topLeftHTML, 200);

		HTML btnLogin = new HTML(application.getMessages().topLoginHTML());
		btnLogin.setStylePrimaryName("btn-Login");
		btnLogin.addClickHandler(new ClickHandler(){
			public void onClick(ClickEvent event) {
				new LoginDialog(application).show();				
			}			
		});
		panel.addEast(btnLogin, 40);

		initWidget(panel);
	}

	public void updateUI(){
		//do nothing
	}

}
